<div class="cl pd-5 bg-1 bk-gray"> 
	<span class="r">共有数据：<strong>{$count}</strong> 条</span>
</div>
<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th width="25">ID</th>
			<th>房间号</th>
			<!--
			<th>签约时间</th>
			<th>截止时间</th>
			<th>优惠编号</th>-->
			<th>用户名</th>
			<th>类型</th>
			<th>收费月份</th>
			<th>租金</th>
			<th>物业费</th>
			<th>水费</th>
			<th>电费</th>
			<th>其他</th>
			<th>费用开始</th>
			<th>费用截止</th>
			<th>总金额</th>
			<th>优惠金额</th>
			<th>应缴金额</th>
			<th>账单状态</th>
			<th>生成时间</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($list) && count($list)){ ?>
			<?php foreach($list as $k=>$ls){ ?>
				<tr class="text-c">
					<td><input type="checkbox" value="{$ls['order_id']}" name=""></td>
					<td width="40"><?php echo ($page-1)*C('PAGE_SIZE')+($k+1); ?></td>
					<td>{$ls['roomnumber']}</td>
					<!--
					<td>{$ls['btime']|date='Y-m-d', ###}</td>
					<td>{$ls['etime']|date='Y-m-d', ###}</td>
					<td>{$ls['eventtype_id']}</td>-->
					<td>{$ls['member_nick']}</td>
					<td>{$ls['order_type'] == 1 ? '固定' : '日常'}</td>
					<td>{$ls['month']}</td>
					<td><p class="c-primary">{$ls['rent']}</p></td>
					<td><p class="c-error">{$ls['property']}</p></td>
					<td><p class="c-success">{$ls['rates1']}</p></td>
					<td><p class="c-success">{$ls['rates2']}</p></td>
					<!--<td><p class="c-success">{$ls['rates3']}</p></td>-->
					<td><p class="c-success">{$ls['other']}</p></td>
					<td><?php echo $ls['order_type'] == 1 ? date('Y-m-d', $ls['begin_time']) : '--'; ?></td>
					<td><?php echo $ls['order_type'] == 1 ? date('Y-m-d', $ls['end_time']) : '--'; ?></td>
					<td>{$ls['total']}</td>
					<td>{$ls['discount']}</td>
					<td>{$ls['account']}</td>
					<td>
						<?php if(session('user_id') != 1){ ?>
							<?php
								switch($ls['status']){
									case -1:
										echo '未审核';
									break;
									case 0:
										echo '未结清';
									break;
									case 1:
										echo '已缴费';
									break;
									case 2:
										echo '无效';
									break;
								}
							?>
						<?php }else{ ?>
							<span class="select-box radius" style="width: 80px">
								<select class="select mstatus" size="1" o_id="{$ls['order_id']}">
									<option value="-1" <?php echo $ls['status'] == -1 ? 'selected' : ''; ?>>未审核</option>
									<option value="0" <?php echo $ls['status'] == 0 ? 'selected' : ''; ?>>未缴费</option>
									<option value="1" <?php echo $ls['status'] == 1 ? 'selected' : ''; ?>>已缴费</option>
									<option value="2" <?php echo $ls['status'] == 2 ? 'selected' : ''; ?>>无效</option>
								</select>
							</span>	
						<?php } ?>
					</td>
					<td>{$ls['ordertime']|date="Y-m-d H:i:s", ###}</td>
				</tr>
			<?php }?>
		<?php }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...{$xu}</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<!--page-->
<include file="Common/page" />
<script type="text/javascript">
	$(document).ready(function(){
		$(".mstatus").on('change', function(){
			var obj = $(this);
			var orderid = obj.attr('o_id');
			$.post('edit.html', {orderid: orderid, status: obj.val()}, function(row){
				if(row/1){
					layer.msg('审核成功', {icon: 1, time: 2000}, function(){
						//location.reload();
					});
				}else{
					layer.msg('操作失败', {icon: 2, time: 2000});
				}
			});
		});

		/*全选*/
		$("table thead th input:checkbox").on("click" , function(){
			$(this).closest("table").find("tr > td:first-child input:checkbox")
					.prop("checked",$("table thead th input:checkbox")
					.prop("checked"));
	    });
		
	});
</script>